import request from "@/utils/request";

//获取所有Role权限
export function getRoleList() {
    return request({ url: `/sys/role`, method: 'get' })
}

//获取所有权限
export function getPermissionList() {
    return request({ url: `/sys/permission`, method: 'get' })
}

//根据ID更新权限点详情
export function setPermissionById(id, data) {
    return request({ url: `/sys/permission/${id}`, method: 'put', data })
}

//根据ID获取权限点详情
export function getPermissionById(id) {
    return request({ url: `/sys/permission/${id}`, method: 'get' })
}

//根据id删除权限点
export function delPermissionById(id) {
    return request({ url: `/sys/permission/${id}`, method: 'delete' })
}

//添加权限点
export function addlPermission(data) {
    return request({ url: `/sys/permission`, method: 'POST', data })
}

//修改id员工权限
export function assignRoles(data) {
    return request({ url: `/sys/user/assignRoles`, method: 'put', data })
}